package al.xc.liveapi;

import al.xc.common.task.TaskThread;
import al.xc.common.util.SingleUtils;
import al.xc.redis.IRedisConfig;
import al.xc.redis.RedisConnectManager;
import al.xc.task.DelayService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class StartupRunner implements CommandLineRunner {

    @Override
    public void run(String... args) throws Exception {
        SingleUtils.instance(TaskThread.class).initialize(4, "task_thread");
        SingleUtils.instance(DelayService.class).initialize(2, null, (DelayService.IDataCache) null);
        SingleUtils.instance(RedisConnectManager.class).initialize(SingleUtils.instance(IRedisConfig.class));
    }
}
